package learn.design.patterns.F_Proxy.Jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Objects;

public class MyInvocationHandler implements InvocationHandler {
    private Object target;

    public MyInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("Before dynamic proxy action...");
        Object result = method.invoke(target, args);
        System.out.println("After dynamic proxy action...");
        return result;
    }
}
